<template>
    <div style="width:100%;height:100%;" id="qvisite_volume_con"></div>
</template>

<script>
    import echarts from 'echarts';
    import $http from '../../../utils/axiosWrap';
    export default {
        name: 'ptZtj',
        data () {
            return {
                listArr: []
            };
        },
        mounted () {
            let _this = this
            let params = new URLSearchParams()
            $http.post('backgroundBuyOreLog/accountTotal',params).then(function (res) {
                _this.listArr.push(res.result)
                _this.$nextTick(() => {
                    let visiteVolume = echarts.init(document.getElementById('qvisite_volume_con'));
                    let xAxisData = [];
                    let data1 = [];
                    let data2 = [];
                    for (let i = 0; i < 20; i++) {
                        xAxisData.push('类目' + i);
                        data1.push((Math.sin(i / 5) * (i / 5 - 10) + i / 6) * 5);
                        data2.push((Math.cos(i / 5) * (i / 5 - 10) + i / 6) * 5);
                    }

                    const option = {
                        tooltip: {
                            trigger: 'axis',
                            axisPointer: {
                                type: 'shadow'
                            }
                        },
                        grid: {
                            top: '2%',
                            left: '2%',
                            right: '4%',
                            bottom: '3%',
                            containLabel: true
                        },
                        xAxis: {
                            type: 'value',
                            boundaryGap: [0, 0.01]
                        },
                        yAxis: {
                            type: 'category',
                            data: ['锁仓AITC总和','锁仓释放AITC','锁仓锁仓AITC','锁仓本金矿石','锁仓奖励矿石', '锁仓释放矿石','锁仓转入矿石',
                                '锁仓矿石本金和利润矿石','锁仓AITC上限','锁仓矿石总量','BB账户AITC总量','BB账户USDI总量','BB账户冻结AITC数量',
                                'BB账户冻结USDI数量','BB账户可用AITC数量','BB账户可用USDI数量','CTC可用矿石','CTC冻结矿石','CTC可用USDI','CTC冻结USDI',
                                'CTC矿石总量','CTC-USDI总量','矿机锁仓AITC','矿机释放AITC','矿机静态收益','矿机动态收益','可兑换积分的动态收益','矿机总收益',
                                '累计矿机静态收益','累计矿机动态收益','累计可兑换积分的动态收益','累计矿机总收益','矿机总AITC',
                                '积分总量','所有AITC','所有USDI','总量矿石总量'],
                            nameTextStyle: {
                                color: '#c3c3c3'
                            }

                        },
                        series: [
                            {
                                name: '总量',
                                type: 'bar',
                                data: [
                                    {value: _this.listArr[0].LOCKSumAITC / 1, name: '锁仓AITC总和', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].LOCKUnlockAitc / 1, name: '锁仓释放AITC', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].LOCKLockAITC / 1, name: '锁仓锁仓AITC', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].LOCKBasicOre / 1, name: '锁仓本金矿石', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].LOCKReturnOre / 1, name: '锁仓奖励矿石', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].LOCKUnlockOre / 1, name: '锁仓释放矿石', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].LOCKShiftORe / 1, name: '锁仓转入矿石', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].LOCKOreSum / 1, name: '锁仓矿石本金和利润矿石', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].LOCKAITCUpper / 1, name: '锁仓AITC上限', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].LOCKOreTotal / 1, name: '锁仓矿石总量', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].BBCAITC / 1, name: 'BB账户AITC总量', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].BBCUSD / 1, name: 'BB账户USDI总量', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].BBClockAITC / 1, name: 'BB账户冻结AITC数量', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].BBClockUSD / 1, name: 'BB账户冻结USDI数量', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].BBCUsableAITC / 1, name: 'BB账户可用AITC数量', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].BBCUsableUSD / 1, name: 'BB账户可用USDI数量', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].CTCUsableOre / 1, name: 'CTC可用矿石', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].CTCLockOre / 1, name: 'CTC冻结矿石', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].CTCUsableUSdi / 1, name: 'CTC可用USDI', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].CTCLockUSdi / 1, name: 'CTC冻结USDI', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].CTCOreTotal / 1, name: 'CTC矿石总量', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].CTCUsdiTotal / 1, name: 'CTC-USDI总量', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].ORELockAITC / 1, name: '矿机锁仓AITC', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].OREUpAITC / 1, name: '矿机释放AITC', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].OREStatic / 1, name: '矿机静态收益', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].OREDynamic / 1, name: '矿机动态收益', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].OREExchangeINTEGRAl / 1, name: '可兑换积分的动态收益', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].ORETotalEarnings / 1, name: '矿机总收益', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].TotalOREStatic / 1, name: '累计矿机静态收益', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].TotalOREDynamic / 1, name: '累计矿机动态收益', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].TotalOREFree / 1, name: '累计可兑换积分的动态收益', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].TotalORETotal / 1, name: '累计矿机总收益', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].ORESumAITC / 1, name: '矿机总AITC', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].Integral / 1, name: '积分总量', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].AITCTOTAL / 1, name: '所有AITC总量', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].USDTOTAL / 1, name: '所有USDI总量', itemStyle: {normal: {color: '#2d8cf0'}}},
                                    {value: _this.listArr[0].ORETOTAL / 1, name: '总量矿石总量', itemStyle: {normal: {color: '#2d8cf0'}}}
                                ]
                            }
                        ]
                    };
                    visiteVolume.setOption(option);

                    window.addEventListener('resize', function () {
                        visiteVolume.resize();
                    });
                });
            })
        }
    };
</script>
